package com.qcby.chatservice.web.conroller;


import cn.hutool.core.bean.BeanUtil;
import com.qcby.chatservice.web.entity.param.ReviewParam;
import com.qcby.chatservice.common.result.Result;
import com.qcby.chatservice.entity.dto.ReviewDto;
import com.qcby.chatservice.service.IReviewService;
import org.redisson.api.RedissonClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 好友申请
 *
 * @author cong.zhen
 * @date 2023/01/14
 */
@RestController
@RequestMapping("chatService/review/")
public class ReviewController {

    @Resource
    private IReviewService reviewService;

    @PostMapping("creatReview")
    public Result<Boolean> creatReview(@RequestBody ReviewParam reviewParam) {
        ReviewDto reviewDto = BeanUtil.copyProperties(reviewParam, ReviewDto.class);
        boolean result = reviewService.creatReview(reviewDto);
        return Result.getSuccessResult(result);
    }
}
